﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<zeus.Core.PlanCliente>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">

    <h2><%=Model.Planes.Nombre %></h2>
    <% Html.EnableClientValidation(); %>


    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

            <table>
                <tr>
                    <td>
                        <div class="editor-label">
                            Unidades         
                        </div>

                        <div class="editor-field">
                             <%: Html.ListBox("UsuariosDisponiblesList", ViewData["usuariosDisponibles"] as MultiSelectList, new { @class = "selectMultiple" })%>                                                             
                        </div>
                    </td>
                    <td>
                        <input type="button" value="Agregar" name="btnAgregarUsuario" id="btnAgregarUsuario" class="buttonMultiple" />
                        <br />
                        <input type="button" value="Remover" name="btnRemoverUsuario" id="btnRemoverUsuario" class="buttonMultiple" />
                    </td>
                    <td>
                        <div class="editor-label">
                            Disponible para
                        </div>

                        <div class="editor-field">
                             <%: Html.ListBox("UsuariosSeleccionadosList", ViewData["usuariosSeleccionados"] as MultiSelectList, new { @class = "selectMultiple" })%>   
                        </div>
                    </td>
                </tr>
            </table>

            
            <%if (Model.Planes.Peridiocidad)
              {
                  %>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.CodigoPeridiocidad) %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownList("CodigoPeridiocidad") %>
                <%: Html.ValidationMessageFor(model => model.CodigoPeridiocidad) %>
            </div>
                  <%
              } %>
            
            <%if (Model.Planes.Intervalo)
              {
                  %>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.CodigoIntervalo) %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownList("CodigoIntervalo") %>
                <%: Html.ValidationMessageFor(model => model.CodigoIntervalo) %>
            </div>
                  <%
              } %>
            
            <%if (Model.Planes.Resumen)
              {
                  %>
            <div class="editor-field">
                <%: Html.CheckBoxFor(model => model.Resumen) %>
                <%: Html.LabelFor(model => model.Resumen) %>
                <%: Html.ValidationMessageFor(model => model.Resumen) %>
            </div>
                  <%
              } %>      
            
            <%if (Model.Planes.Velocidad)
              {
                  %>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Velocidad) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Velocidad) %>
                <%: Html.ValidationMessageFor(model => model.Velocidad) %>
            </div>
                  <%
              } %>
            
            <%if (Model.Planes.Celular)
              {
                  %>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Celular) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Celular) %>
                <%: Html.ValidationMessageFor(model => model.Celular) %>
            </div>
                  <%
              } %>
            
            <%if (Model.Planes.Mail)
              {
                  %>
             <div class="editor-label">
                <%: Html.LabelFor(model => model.Mail) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Mail) %>
                <%: Html.ValidationMessageFor(model => model.Mail) %>
            </div>
                  <%
              } %>
           
            <%if (Model.Planes.Condicion)
              {
                  %>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Condicion) %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownList("Condicion") %>
                <%: Html.ValidationMessageFor(model => model.Condicion) %>
            </div>
                  <%
              } %>                
              
            <%: Html.HiddenFor(model => model.UsuariosHidden) %>      
            <%: Html.HiddenFor(model=>model.CodigoCliente) %>        
            <%: Html.HiddenFor(model=>model.CodigoPlan) %>        
            
            <p>
                <input type="submit" value="Guardar" />
                <input type="button" onclick="javascript:document.location.href='<%= ResolveUrl("~") %>Planes/Basico'" value="Cancelar" />
            </p>
        

    <% } %>

    
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContentPlaceHolder" runat="server">
    <script type="text/javascript" src="<%= ResolveUrl("~") %>Scripts/MicrosoftAjax.js"></script>
    <script type="text/javascript" src="<%= ResolveUrl("~") %>Scripts/MicrosoftMvcAjax.js"></script>
    <script type="text/javascript" src="<%= ResolveUrl("~") %>Scripts/MicrosoftMvcValidation.js"></script>
    <script type="text/javascript" src="<%= ResolveUrl("~") %>Scripts/helpers.js"></script>

    <script language="javascript" type="text/javascript">
        $(function () {
            $("#navbar").hide();

            $('form').submit(function () {
                var tmp = new Array();
                $('select#UsuariosSeleccionadosList option').each(function (i, selected) {
                    tmp[i] = $(selected).val();
                });
                $('#UsuariosHidden').val(tmp.join(','));
                
                return true;
            });

            $('#UsuariosDisponiblesList').dblclick(function () {
                $('#UsuariosDisponiblesList option:selected').remove().appendTo('#UsuariosSeleccionadosList');
            });

            $('#btnAgregarUsuario').click(function () {
                $('#UsuariosDisponiblesList option:selected').remove().appendTo('#UsuariosSeleccionadosList');
            });

            $('#UsuariosSeleccionadosList').dblclick(function () {
                $('#UsuariosSeleccionadosList option:selected').remove().appendTo('#UsuariosDisponiblesList');
            });

            $('#btnRemoverUsuario').click(function () {
                $('#UsuariosSeleccionadosList option:selected').remove().appendTo('#UsuariosDisponiblesList');
            });
        });        
    </script>

    <title>Plan Básico</title>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MenuContentPlaceHolder" runat="server">
</asp:Content>

